package com.zhouyu.advice;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * @author yangjian
 */
public class TestMethodInterceptor implements MethodInterceptor {
	@Nullable
	@Override
	public Object invoke(@NotNull MethodInvocation invocation) throws Throwable
	{

		System.out.printf("方法 %s 执行前...%n", invocation.getMethod().getName());
		Object proceed = invocation.proceed();
		System.out.printf("方法 %s 执行后...%n", invocation.getMethod().getName());
		return proceed;
	}
}
